home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / Thread Manager Extension 2.0.1 / Sample Applications / Power Examples / SortPicts / Source / main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-03  |  3.2 KB  |  129 lines  |  [TEXT/MPS ]

  1. /*********************************************************************************
  2.  *
  3.  *    Main Function Prototypes and constant declarations
  4.  *
  5.  *    Main.h    -    C Headers
  6.  *
  7.  *      Copyright © Apple Computer, Inc. 1988 - 1993
  8.  *      All rights reserved.
  9.  *
  10.  *
  11.  *    Here are declarations for all of the C routines.  These are used for
  12.  *    compile-time checking of our parameters.
  13.  *    
  14.  *********************************************************************************/
  15.  
  16. #ifndef __MAINOBJ__
  17. #define __MAINOBJ__
  18.  
  19. #include "MacHeaders.h"
  20.  
  21. void    initToolbox( void);
  22. void    MainEventLoop( void);
  23.  
  24.  
  25.  
  26. //    Event-Handling routines
  27. void    HandleEvent( EventRecord *event);
  28. void    HandleActivate( EventRecord *event);
  29. void    HandleDiskInsert( EventRecord *event);
  30. void    HandleKeyPress( EventRecord *event);
  31. void    HandleMouseDown( EventRecord *event);
  32. void    HandleOSEvent( EventRecord *event);
  33. void    HandleUpdate( EventRecord *event);
  34. void    AppAdjustMenus(void);
  35. void    AppMenu( short menu, short item);
  36. void    AppAdjustCursor( RgnHandle cursorRgn);
  37. void    HandleNoEvent( void);
  38.  
  39. //    Utility routines
  40.  
  41. Boolean    CloseAnyWindow( WindowPtr window);
  42. Boolean    CloseAllAppWindows( void);
  43. void    AppConvertScrap( void);
  44. void    DeathAlert( short errorNumber);
  45. void    DeathAlertStr( char *string);
  46. void    DeathAlertStrErr( char *string, OSErr errCode);
  47. Boolean    IsAppWindow( WindowPtr window);
  48. Boolean    IsDAWindow( WindowPtr window);
  49. Boolean    IsDialogWindow( WindowPtr window);
  50. void    InvalidateScrollbars(WindowPtr theWindow);
  51. Boolean    TrapExists(short theTrap);
  52. TrapType    GetTrapType(short theTrap);
  53. short    NumToolboxTraps(void);
  54.  
  55. //    Global variables
  56.  
  57. extern    SysEnvRec    gMac;
  58. extern    Boolean        gQuit;
  59. extern    Boolean        gInBackground;
  60.  
  61. #define    true    1
  62. #define    false    0
  63.  
  64. #ifndef nil
  65. #define    nil        (void *)0
  66. #endif
  67.  
  68. #define    NIL        0L
  69. #define    MAXLONG    0x7FFFFFFF
  70.  
  71. /**************************************************************************************
  72.  
  73.     Define HiWrd and LoWrd macros for efficiency
  74.     
  75. ***************************************************************************************/
  76.  
  77. #define    HiWrd(aLong)    (short)(((aLong) >> 16) & 0xFFFF)
  78. #define    LoWrd(aLong)    (short)((aLong) & 0xFFFF)
  79.  
  80.  
  81. /* ================================================================================= */
  82. /* =========================  R E S O U R C E   N U M B E R S ====================== */
  83. /* ================================================================================= */
  84.  
  85. #define    rAboutAlert            128
  86. #define    rErrorAlert            129
  87. #define    rErrorStrings        128
  88.  
  89. #define    errWimpyROMs        1
  90. #define    errWimpySystem        2
  91. #define    errNoMenuBar        3
  92. #define errWimpy68K            4
  93. #define errWimpyQD            5
  94. #define    errNoThreads        6
  95. #define ERRORUnuseGWorld    7
  96.  
  97. /*    The following constants are used to identify menus and their items.  The menu
  98.     IDs have an "m" prefix and the item numbers within each menu have an "i" prefix. */
  99.  
  100. #define    rMenuBar        128
  101.  
  102. #define    mApple            128
  103. #define    iAbout            1
  104.  
  105. #define    mFile            129
  106. #define    iNew            1
  107. #define    iOpen            2
  108. #define    iLinell            3
  109. #define    iClose            4
  110. #define    iSave            5
  111. #define    iSaveAs            6
  112. #define    iRevert            7
  113. #define    iLine12            8
  114. #define    iPageSetup        9
  115. #define    iPrint            10
  116. #define    iLine13            11
  117. #define    iQuit            12
  118.  
  119. #define    mEdit            130
  120. #define    iUndo            1
  121. #define    iLine21            2
  122. #define    iCut            3
  123. #define    iCopy            4
  124. #define    iPaste            5
  125. #define    iClear            6
  126.  
  127. #endif
  128.  
  129.